fix(memo): skip {children} hole substitution when wrapped component h…#6466
fix(memo): skip {children} hole substitution when wrapped component h…#6466carlosabadia merged 2 commits intomainfrom
Conversation
…as no structural children
Greptile SummaryThis PR fixes a JSX prop clobbering bug in the auto-memoization pipeline for components that own their own
Confidence Score: 4/5Safe to merge; the change is a one-guard early return that restores correct JSX output for components like The fix is surgical and the
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["create_passthrough_component_memo(component)"] --> B["new_component = copy(component)"]
B --> C{render_snapshot?}
C -- yes --> D["return new_component\n(snapshot mode)"]
C -- no --> E{"component.children\nempty? (NEW GUARD)"}
E -- yes --> F["return new_component\n(no hole substitution)\npassthrough_hole_child = None"]
E -- no --> G["hole_bare = Bare.create(children)\nnew_component.children = [hole_bare]\ndelegate _get_all_refs"]
G --> H["return new_component\npassthrough_hole_child = hole_bare"]
F --> I["compile_experimental_component_memo"]
H --> I
I --> J{hole_child is not None?}
J -- yes --> K["Shallow copy + hole swap\nrender with {children} placeholder"]
J -- no --> L["deepcopy + full render\n(no hole, component owns its JSX)"]
Reviews (1): Last reviewed commit: "fix(memo): skip {children} hole substitu..." | Re-trigger Greptile |
Merging this PR will not alter performance
Comparing Footnotes
|
…as no structural children